<?php
namespace Acme\Likipe\BlogBundle\Controller;

use Doctrine\ORM\Query\AST\Functions\ConcatFunction;

use Symfony\Component\HttpFoundation\Request;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;

// Entity
use Acme\Likipe\BlogBundle\Entity\Blog;

class CommonController extends Controller{
	public function leftmenuAction(){
		$oEm = $this->getDoctrine()->getEntityManager();
		
		$oBlogs = $oEm->getRepository( 'AcmeLikipeBlogBundle:Blog' )->findAll();
		
		if($oBlogs == null){
			$this->get( 'session' )
				->setFlash( 'leftmenu_warning', 'No Blog found!' );
		}
		
		return $this
			->render( 'AcmeLikipeBlogBundle:Module:content_left.html.twig',
				array( 'blogs' => $oBlogs ));
	}
}
?>